<?php include('../resources/views/header.blade.php'); ?>


<section>
    <p style="margin-left:12px;">最新问题</p>
</section>

<section style="background-color:#fff;">
    <?php
        if( isset($questions) ){
            foreach( $questions as $key => $val ){
                echo '<a href="/detail/'.$val->id.'">';
                echo '<div style="padding-top:12px;padding-bottom:12px;padding-left:16px;padding-right:16px;">';
            	echo '	<p style="margin:0;font-size:16px;color:#333;">'.$val->title.'</p>';
            	echo '	<div style="margin-top:5px;">';
                $temp_answers_count = isset($answers_count[$val->id]) ? $answers_count[$val->id] : 0;
            	echo '		<span style="color:#888;font-size:12px;">回答 '.$temp_answers_count.'</span>';
                $temp_attentions_count = isset($attentions_count[$val->id]) ? $attentions_count[$val->id] : 0;
            	echo '		<span style="margin-left:12px;color:#888;font-size:12px;">关注 '.$temp_attentions_count.'</span>';
            	echo '	</div>';
            	echo '</div>';
                echo '</a>';
                if( $key < count($questions)-1 ){
                    echo '<div style="height:1px;background-color:#eee;margin-left:16px;margin-right:16px;"></div>';
                }
            }
        }
    ?>
</section>



<?php include('../resources/views/footer.blade.php'); ?>
